package cheme.ProcessModel.Cmds;

import cheme.ProcessModel.Table.ITextModel;


public class SetModelTextCmd extends ChemeCommand
{
	ITextModel model = null;
	String newText = "";
	String oldText = "";
	
	public SetModelTextCmd(ITextModel model, String newText)
	{
		super(model, "Set Model Text");
			
		this.model = model;
		this.newText = newText;
	}

	@Override
	public void primExecute()
	{
		oldText = model.getText();
		model.setText(newText);
	}
	
	@Override
	public void primRedo()
	{
		model.setText(newText);
	}

	@Override
	public void primUndo()
	{
		model.setText(oldText);
	}
}
